package com.gongzhiyun.springboot3test.base;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;

@Data
@Schema(description = "分页信息")
public class PageBean implements Serializable {
    @Serial
    private static final long serialVersionUID = 1L;
    @Schema(description = "当前页码",example = "1")
    private Integer pageNum;
    @Schema(description = "每页显示条数",example = "10")
    private Integer pageSize;
    @Schema(description = "总页数",example = "10")
    private long pages;
    @Schema(description = "总记录数",example = "100")
    private long total;
    @Schema(description = "排序字段",example = "id")
    private Integer order;

    public static PageBean instance(Integer pn,Integer ps){
        PageBean pageBean=new PageBean();
        pageBean.setPageNum(pn);
        pageBean.setPageSize(ps);
        return pageBean;

    }

}
